package com.jiangman.weather.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import com.jiangman.weather.MainActivity;
import com.jiangman.weather.R;
import com.jiangman.weather.constant.ConstantUrl;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import util.ToastUitl;

public class SetIpActivity extends AppCompatActivity {

    @BindView(R.id.ip_et)
    EditText ipEt;
    @BindView(R.id.quding)
    Button quding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_set_ip);
        ButterKnife.bind(this);
    }

    @OnClick(R.id.quding)
    public void onClick() {
        String ip="http://"+ipEt.getText().toString().trim()+"/";
        ConstantUrl.baseUrl=ip;
        startActivity(new Intent(this, MainActivity.class));
        ToastUitl.show("设置成功", Toast.LENGTH_SHORT);
        finish();
    }
}
